Skip to content

Instantly share code, notes, and snippets.

# matrix from the `a^i` generator basis to the `a^(-2^i)` normal basis
to_normal = [0x7f50f7fd, 0x95ecaead, 0x495ffebe, 0x90618596, 0x6e0d0395, 0x527b6ec5, 0x563d1cac, 0x1ee02779,
0x287efd13, 0x5a66f53c, 0xdf3df773, 0xa0d25f82, 0x79357a5b, 0xe5c59050, 0x15508e51, 0x498da844,
0xcaf65756, 0x4830c2cb, 0xa93db762, 0x8f7013bc, 0x2d337a9e, 0x50692fc1, 0x72e2c828, 0x24c6d422,
0xa4186165, 0x47b809de, 0xa83497e0, 0x12636a11, 0x23dc04ef, 0x8931b508, 0x4498da84, 0xffffffff]
# inverse of to_normal
from_normal = [0xdb710641, 0x6d930ac3, 0x6d3d2d4d, 0x6567cb95, 0xd7125358, 0x5b358fd3, 0x2e9bb40b, 0x12a59a49,
0x8df9403d, 0x5139de12, 0xba340226, 0x29c45641, 0x12fbc105, 0xecd30c55, 0x3755ebd8, 0x24ee460c,
0x23783fcf, 0x479933fc, 0xa39442a5, 0x9ea0056d, 0xf42608f6, 0x20cacf04, 0x2a0cf83d, 0xeffd8645,
0x2a39a67d, 0x640ebd82, 0x9dfd8792, 0x277402ab, 0xad31bc4f, 0x31536354, 0x5ea35fca, 0x52b55e39]
@luismts
luismts / GitCommitBestPractices.md
Last active May 9, 2024 08:09
Git Tips and Git Commit Best Practices

Git Commit Best Practices

Basic Rules

Commit Related Changes

A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.

Commit Often

Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it‘s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having large commits and sharing them infrequently, in contrast, makes it hard to solve conflicts.

@wojteklu
wojteklu / clean_code.md
Last active May 9, 2024 08:08
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@mislav
mislav / gist:938183
Created April 23, 2011 02:28
Faraday SSL example
connection = Faraday::Connection.new('http://example.com') do |builder|
builder.request :url_encoded # for POST/PUT params
builder.adapter :net_http
end
# same as above, short form:
connection = Faraday.new 'http://example.com'
# GET
connection.get '/posts'
@adriankeenan
adriankeenan / thinkpad_p1_gen4_usbcpd_charging.md
Last active May 9, 2024 08:05
ThinkPad P1 Gen 4 USB-C PD Charging Testing

The ThinkPad P1 has no official requirements for USB-C chargers. This is the result of testing a few different USB-C chargers on my Gen 4 P1.

Notes:

  • Machine BIOS is N40ET44W 1.26.
  • This configuration (i7 11850H, RTX A3000) shipped with a 230W AC charger.
  • Result wattage read from Lenovo Vantage on Windows 11 Pro.
  • Windows does not acknowledge unsupported chargers at all (eg does not show any error messages). A KDE desktop does show a message that the wattage is too low for unsupported chargers.
  • Tested with a 100W C-C cable or 100W TB4 cable.

| Charger | Charger Wattage | Result |

@notnotrobby
notnotrobby / cgp.md
Last active May 9, 2024 08:01
List of free resources to study computer graphics programming.
@phoe
phoe / package-local-nicknames.md
Last active May 9, 2024 08:01
Package-local nicknames in Common Lisp - a semishitpost about PLNs

Package-local nicknames in Common Lisp

Warning: this is a rant.

Warning: you have been warned.

Note: actually worthwhile content starts in the second subsection. You are free to skip the first one.

Story time

@julyL
julyL / .prettierrc.js
Created March 9, 2020 06:17
.prettierrc.js配置文件
// .prettierrc.js
module.exports = {
// 一行最多 80 字符
printWidth: 80,
// 使用 2 个空格缩进
tabWidth: 2,
// 不使用缩进符,而使用空格
useTabs: false,
// 行尾需要有分号
semi: true,
@staltz
staltz / introrx.md
Last active May 9, 2024 07:59
The introduction to Reactive Programming you've been missing